/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package manager;

import entity.Publisher;
import iface.IManager;
import java.util.ArrayList;

/**
 *
 * @author User
 */
public class PublisherManager implements IManager<Publisher> {

    private Manager manager;
    private ArrayList<Publisher> publisherList;

    public PublisherManager(Manager manager) {
        publisherList = new ArrayList<Publisher>();
        this.manager = manager;
    }

    @Override
    public void add(Publisher obj) {
        this.publisherList.add(obj);
    }

    @Override
    public void remove(Publisher obj) {
        this.publisherList.remove(obj);
        obj.setStatus(false);
        this.manager.getDisabledPublisherManager().add(obj);
    }

    @Override
    public Publisher replace(int index, Publisher obj) {
        return this.publisherList.set(index, obj);
    }

    @Override
    public int size() {
        return this.publisherList.size();
    }

    @Override
    public Publisher get(int index) {
        return this.get(index);
    }
}
